<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>练习选择题</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<link rel="stylesheet" type="text/css" href="css/main.css" />
  </head>
  
  <body>
  	<%@ include file="header.jsp" %>
    
    <DIV id=tips>
		<P class=tips_left>
			您的位置：<A>首页</A> 
			&gt;&gt; <A>练习</A>
			&gt;&gt; <A>练习选择题</A>
		</P>
	</DIV>
		
	<DIV id=container>
		<DIV id=list_left>
			<%@ include file="left_exercise.jsp" %>
		</DIV>
		<DIV id=list_right>
			<DIV id=subnav>
				<UL class=subnav_ul1></UL>
				<UL class=subnav_ul2>
					<DIV class=subnav_t>
						<P class=subnav_tl>练习选择题</P>
  						<P class=subnav_tr></P>
  					</DIV>
  					<DIV class=subnav_nr>
  						<form id="exerciseXuanzeSetting2" name="exerciseXuanzeSetting2" action="student/exerciseXuanzeSetting.html" method="post">
  							<table width="600" align="center" border="0" cellpadding="0" cellspacing="0">
  								<tr>
						        	<td class="row_title">
						        		练习选择题
						        	</td>
						        </tr>
						        <tr>
						        	<td class="row_subTitle">
						        		章节：<a style="color:blue">${chapterName}</a>
						        		<input type="hidden" name="chapter" value="${chapterID}" />
						        		&nbsp;&nbsp;&nbsp;
						        		难度：<a style="color:blue">${difficulty}</a>
						        		<input type="hidden" name="difficulty" value="${difficulty}" />
						        		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						        		<input class="row_btn" type="submit" value="继续练习">
						        	</td>
						        </tr>
  							</table>
  						</form>
  						<form id="exerciseXuanze" name="exerciseXuanze" action="student/exerciseXuanze.html?chapterID=${chapterID}&difficulty=${difficulty}" method="post">
					    	<table width="600" align="center" border="0" cellpadding="0" cellspacing="0">
						        <c:forEach items="${xuanzeList}" var="xuanze" varStatus="status">
								<tr>
						        	<td class="row_name" colspan="3">
						        		<c:out value="${status.index + 1}" />.&nbsp;
						        		${xuanze.description}
						        		<input type="hidden" name="xuanzeID_${status.index}" value="${xuanze.id}" />
						        		<input type="hidden" name="answer_order_${status.index}" value="${xuanze.answer_order}" />
						        	</td>
								</tr>
								<tr>
						        	<td class="row_name" colspan="2">
						        		<input type="radio" name="user_answer_${status.index}" value="0" <c:if test="${xuanze.user_answer == 0}">checked</c:if> />A. ${xuanze.answer_a}
						        		<br/>
										<input type="radio" name="user_answer_${status.index}" value="1" <c:if test="${xuanze.user_answer == 1}">checked</c:if> />B. ${xuanze.answer_b}
										<br/>
										<input type="radio" name="user_answer_${status.index}" value="2" <c:if test="${xuanze.user_answer == 2}">checked</c:if> />C. ${xuanze.answer_c}
										<br/>
										<input type="radio" name="user_answer_${status.index}" value="3" <c:if test="${xuanze.user_answer == 3}">checked</c:if> />D. ${xuanze.answer_d}
						        	</td>
						        	<td width="20%">
						        		<c:choose>
							 				<c:when test="${xuanze.answer_result == 1}">
							 					<img src="css/images/right.gif"/>
											</c:when>
											<c:when test="${xuanze.answer_result == 0}">
							 					<img src="css/images/wrong.gif"/>
							 					&nbsp;&nbsp;&nbsp;正确答案：
							 					<c:if test="${xuanze.right_answer_pos == 0}">A</c:if>
							 					<c:if test="${xuanze.right_answer_pos == 1}">B</c:if>
							 					<c:if test="${xuanze.right_answer_pos == 2}">C</c:if>
							 					<c:if test="${xuanze.right_answer_pos == 3}">D</c:if>
											</c:when>
							 				<c:otherwise></c:otherwise>
										</c:choose>
						        	</td>
								</tr>
								</c:forEach>
								<tr>
						          	<td width="30%"></td>
						          	<td class="row_submit" width="50%">
						          		<input type="submit" value=" 批改题目 ">
						          	</td>
						          	<td class=error_message>
						          		<a style="color:black">正确率：</a>${correct_count}/${xuanze_num}
						          	</td>
						        </tr>
						    </table>
						</form>
					</DIV>
				</UL>
				<UL class=subnav_ul3></UL>
			</DIV>
		</DIV>
	</DIV>

    <%@ include file="../footer.jsp" %>
  </body>
</html>
